<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>商家注册</title>
<script src="../js/jquery-1.6.js" type="text/javascript" ></script>
<script src="../js/jquery.form.js" type="text/javascript"></script>
<script src="../js/json2.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
	$(document).ready(function(){
		//提交注册
		$("#regbtn").click(function(){
			var options = { 
				url: "Reg.action", 
				dataType: 'json', 
				success: function(data) {				 
					$("#msg_reg").html(data.msg);
			   }				
			}; 			
			$("#regform").ajaxSubmit(options);
		});
		//验证name有效性
		$("#name").blur(function(){	
			$.ajax({
				url:"ValidateUserName.action",
				dataType:'json',
				data:{
					'user.name':$(this).val(),
				},
				success:function(data){									
					$("#msg_name").html(data.msg);
				}
			});				
		});
		//
		$("#password").blur(function(){			
						
		});
	});
</script>
</head>
<body>
<form id="regform" name="refform">
username:<input type="text" id="name" name="user.name"/><span id="msg_name"></span><br/>
password:<input type="text" id="password" name="user.password"/><span id="msg_password"></span><br/>
<input type="button" id="regbtn" value="reg"/><span id="msg_reg"></span>
</form>
</body>
</html>